// ignore_for_file: must_be_immutable, prefer_typing_uninitialized_variables

import 'package:aitao_flutter/res/r.dart';
import 'package:flutter/material.dart';

class VideoCallBtn extends StatefulWidget {
  VideoCallBtn({super.key, this.status = false, required this.videoCallBack});
  final bool status;
  var videoCallBack;
  @override
  State<VideoCallBtn> createState() => _VideoCallBtnState();
}

class _VideoCallBtnState extends State<VideoCallBtn> {
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      child: Container(
        height: 44,
        width: 155,
        alignment: Alignment.center,
        decoration: BoxDecoration(
            borderRadius: const BorderRadius.all(Radius.circular(22)),
            gradient: widget.status == true
                ? const LinearGradient(
                    begin: Alignment.centerLeft,
                    end: Alignment.centerRight,
                    colors: <Color>[Color(0xFFEBBBFF), Color(0xFFD286FE)])
                : const LinearGradient(
                    begin: Alignment.centerLeft,
                    end: Alignment.centerRight,
                    colors: <Color>[Color(0xFFAAAAAA), Color(0xFFAAAAAA)])),
        child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
          Image.asset(ImagePath.assetsShipinIcon),
          const Text(
            '视频通话',
            style: TextStyle(fontSize: 15, color: Colors.white),
          )
        ]),
      ),
      onTap: () {
        if (widget.status == true) {
          widget.videoCallBack();
        }
      },
    );
  }
}
